package com.it135.citytraffic.mapper;

import com.it135.citytraffic.pojo.dto.RoadJamCountReportDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReportMapper {
    @Select("select  rs.name as name,sum(rts.count)  as count from   road_statistic  rs , road_time_statistic rts\n" +
            "where   rs.crossing_id=#{crossingId} and rts.road_statistic_id=rs.id  and rs.status=#{status}  group by rs.name order by count\n" +
            "\n")
    List<RoadJamCountReportDTO> getRoadJam(Integer crossingId, Integer status);
}
